package com.znsd.zl.sys.sys.controller;

import com.znsd.zl.sys.sys.entity.SysUserEntity;
import com.znsd.zl.utils.R;
import org.apache.shiro.SecurityUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserInfoController
 * @Description 系统用户服务对外暴露接口
 * @Author jaypdd
 * @Date 2020/8/22 16:04
 * @Version v1.0
 */
@RequestMapping("/sys/api/user")
public class UserInfoController {

	/**
	 * 获取登录的用户信息
	 */
	@GetMapping("/info")
	@ResponseBody
	public Long getLoginUserToken(){
		return ((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUserId();
	}

}
